import { Transform } from "class-transformer";
import { IsDateString, IsNotEmpty, IsNumber, IsString } from "class-validator";

export class CreateWorkpostDto {
  @IsNotEmpty()
  @IsString()
  workPostName: string;

  @IsNotEmpty()
  @IsString()
  workPostNum: string;

  @IsNotEmpty()
  @IsNumber()
  @Transform((params) => {
    return Number(params.value)
  })
  departmentId: number;

  @IsNotEmpty()
  @IsString()
  departmentName: string;

  @IsNotEmpty()
  @IsString()
  description: string;

  @IsNotEmpty()
  @IsDateString()
  updateTime: Date;
}
